/*
 * @Author: Creator
 * @Date: 2020-09-27 21:42:22
 * @LastEditors: Creator
 * @LastEditTime: 2020-10-09 21:41:01
 * @Description: file content
 */

#ifndef DOCTOR_H_INCLUDED
#define DOCTOR_H_INCLUDED

#include<stdio.h>
#include<stdbool.h>
#include"mytime.h"
typedef struct Doctor
{
	char name[20];
	char ID_number[19];
	char level;
	//4为锟斤拷锟斤拷医师锟斤拷3为锟斤拷锟斤拷锟斤拷医师锟斤拷2为锟斤拷锟斤拷医师锟斤拷1为住院医师
	char subject;//1为锟斤拷锟节科ｏ拷2为锟斤拷锟节科ｏ拷3为锟斤拷锟斤拷锟节科ｏ拷4为锟斤拷锟斤拷疲锟?5为锟斤拷锟斤拷锟斤拷疲锟?6为锟斤拷锟斤拷锟?
	char worknumber[20];//锟斤拷锟斤拷锟脚癸拷20位锟斤拷锟缴匡拷锟斤拷+医锟斤拷锟斤拷锟斤拷+锟斤拷锟斤拷证锟斤拷锟斤拷锟?
	bool ispresent[7];
	int condition;//0锟斤拷示锟斤拷职锟斤拷1锟斤拷示锟斤拷锟斤拷状态锟斤拷2锟斤拷示锟斤拷锟?
	//锟斤拷锟斤拷锟斤拷聘锟斤拷医锟斤拷锟斤拷锟斤拷锟诫到锟斤拷锟斤拷锟斤拷
	int day_worktimes[12][31];
}Doctor;
typedef struct extra_doctor{
      Date time;
      int extra_condition;//锟斤拷时状态只锟斤拷锟斤拷锟斤拷0为锟斤拷职锟斤拷1为锟斤拷锟?
      Doctor data1;
      struct extra_doctor *next;
      struct extra_doctor *pre;
}exDoctorNode;//锟斤拷锟斤拷一锟斤拷专锟脚存储锟斤拷锟斤拷锟街帮拷锟较?锟斤拷锟侥硷拷

typedef struct DoctorNode
{
    Doctor data;
    struct DoctorNode *pre;
    struct DoctorNode * next;
}DoctorNode;

//bool isListEmpty(DoctorNode* List);
//int lenList(DoctorNode* List);
//DoctorNode* createNode(char name[],char ID_number,char level,char subject);                                         // 锟斤拷锟斤拷锟斤拷data 锟斤拷锟斤拷 锟节点并锟斤拷锟截节碉拷锟街?
bool isName(char a[]);
// Doctor *readADoctor(FILE *fp);
DoctorNode* createNullDoctorNode();
/*void print_subject(DoctorNode *List,char sub);
void print_Doctor(Doctor *List);*/
void judge_condition();
void polish_Doctor(DoctorNode *List,char ID_number[18],int condition);
DoctorNode* find_Doctor(DoctorNode*List,char a[19]);
bool delete_Doctor(DoctorNode*List,char a[18]);


// 处理文件
Nature DoctorNum;
DoctorNode* readADoctor(FILE* fp);
DoctorNode* loadDoctorList();
bool writeADoctor(FILE *fp,DoctorNode *doctor);
bool writeDoctorList(DoctorNode *DoctorList);




#endif //DOCTOR_H_INCLUDED